cask "clashx-pro" do
  version "1.118.1"
  sha256 "4df9f4ed4cf20c44477f796bac34e43d209512e506c9820a7d564605c571f8c4"

  url "https://s3.nsloop.com:49001/weilai-app/clash/ClashX.Pro-v1.118.1.dmg"
  name "ClashX Pro"
  desc "Rule-based custom proxy with GUI based on clash"
  homepage "https://github.com/yichengchen/clashX"

  livecheck do
    url :url
    strategy :github_latest
  end

  auto_updates true
  depends_on macos: ">= :sierra"
  conflicts_with cask: ["clashx"]

  app "ClashX Pro.app"

  uninstall delete:    [
              "/Library/LaunchDaemons/com.west2online.ClashXPro.ProxyConfigHelper.plist",
              "/Library/PrivilegedHelperTools/com.west2online.ClashXPro.ProxyConfigHelper",
            ],
            launchctl: "com.west2online.ClashXPro.ProxyConfigHelper",
            quit:      "com.west2online.ClashXPro"

  zap trash: [
    "~/Library/Application Support/com.west2online.ClashXPro",
    "~/Library/Caches/com.crashlytics.data/com.west2online.ClashXPro",
    "~/Library/Caches/com.west2online.ClashXPro",
    "~/Library/Caches/io.fabric.sdk.mac.data/com.west2online.ClashXPro",
    "~/Library/Cookies/com.west2online.ClashXPro.binarycookies",
    "~/Library/Logs/ClashXPro",
    "~/Library/Preferences/com.west2online.ClashXPro.plist",
    "~/.config/clash/",
  ]
end
